#!bin/bash


/opt/module/sqoop/bin/sqoop export \
--connect 'jdbc:mysql://node101:3306/jtp_app_report?useUnicode=true&characterEncoding=utf-8' \
--username root \
--password 123456 \
--table region_ads_report \
--export-dir /user/spark/warehouse/jtp_ads_warehouse/ads_region_ads_report \
--update-mode allowinsert \
--update-key 'dt,province,city,is_invalid_traffic' \
--fields-terminated-by '\001' \
--input-null-non-string '\\N' \
--input-null-string '\\N' \
--num-mappers 1


/opt/module/sqoop/bin/sqoop export \
--connect 'jdbc:mysql://node101:3306/jtp_app_report?useUnicode=true&characterEncoding=utf-8' \
--username root \
--password 123456 \
--table platform_ads_report \
--export-dir /user/spark/warehouse/jtp_ads_warehouse/ads_platform_ads_report \
--update-mode allowinsert \
--update-key 'dt,platform_id,platform_name_zh,is_invalid_traffic' \
--fields-terminated-by '\001' \
--input-null-non-string '\\N' \
--input-null-string '\\N' \
--num-mappers 1

/opt/module/sqoop/bin/sqoop export \
--connect 'jdbc:mysql://node101:3306/jtp_app_report?useUnicode=true&characterEncoding=utf-8' \
--username root \
--password 123456 \
--table os_ads_report \
--export-dir /user/spark/warehouse/jtp_ads_warehouse/ads_os_ads_report \
--update-mode allowinsert \
--update-key 'dt,client_os_type,is_invalid_traffic' \
--fields-terminated-by '\001' \
--input-null-non-string '\\N' \
--input-null-string '\\N' \
--num-mappers 1

/opt/module/sqoop/bin/sqoop export \
--connect 'jdbc:mysql://node101:3306/jtp_app_report?useUnicode=true&characterEncoding=utf-8' \
--username root \
--password 123456 \
--table hour_ads_report \
--export-dir /user/spark/warehouse/jtp_ads_warehouse/ads_hour_ads_report \
--update-mode allowinsert \
--update-key 'dt,ad_id,ads_name,hour_str,is_invalid_traffic' \
--fields-terminated-by '\001' \
--input-null-non-string '\\N' \
--input-null-string '\\N' \
--num-mappers 1
